<template>
  <div class="sidebar">
    <sidebar/>
  </div>
  <div class="right" :class="{ right_hidden: !collapse }">
    <top/>
    <div class="main">
      <tags/>

      <router-view class="main_view" v-slot="{ Component ,route}">
        <keep-alive>
            <component :key="route.name" :is="Component" v-if="$route.meta.keepAlive"/>
        </keep-alive>
          <component :key="route.name" :is="Component" v-if="!$route.meta.keepAlive"/>
      </router-view>
    </div>
  </div>
</template>

<script>
import {mapGetters} from "vuex";
import top from "@/page/top/index.vue";
import sidebar from "@/page/sidebar/index.vue";
import tags from "@/page/index/tags.vue";

export default {
  name: "default",
  components: {
    top,
    sidebar,
    tags,
  },
  computed: mapGetters(["collapse"]),
};
</script>

